﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using Happy.Web.Mvc;
using Happy.Cms.Application.Articles;

namespace Ciep.WebSite.Controllers
{
    public class TeamController : CiepController
    {
        private static readonly string _CategoryName = "研究团队";

        //
        // GET: /Team/

        public ActionResult Index()
        {
            this.ViewBag.Title = _CategoryName;

            var articles = this.Service<ArticleQueryService>()
                .FindByCategoryName(_CategoryName);

            this.SetCommonDataToViewBag();

            return View(articles);
        }

        public ActionResult Top()
        {
            var articles = this.Service<ArticleQueryService>()
                .FindByCategoryName(_CategoryName, 6);

            return View(articles);
        }

        public ActionResult Detail(Guid id)
        {
            var article = this.Service<ArticleQueryService>()
                .SingleOrDefault(id);

            this.SetCommonDataToViewBag();

            return View(article);
        }

        protected override string Title
        {
            get { return _CategoryName; }
        }

        protected override int MenuIndex
        {
            get { return 2; }
        }
    }
}
